$f(x, y) = \left( y\cos(xy) + 1, x\cos(xy) + 1 \right)$ Find $F$ such that $f = \nabla F$. $F(x, y) =$ $ + \, C$
We know that $\nabla F = f$. Therefore: $\begin{aligned} F_x &= y\cos(xy) + 1 \\ \\ F_y &= x\cos(xy) + 1 \end{aligned}$ Let's integrate these two equations. Instead of getting a constant at the end of each integral, we'll get a function of the variable with respect to which we didn't integrate. [Example] $\begin{aligned} F &= \int F_x \, dx \\ \\ &= \int y\cos(xy) + 1 \, dx \\ \\ &= \dfrac{y\sin(xy)}{y} + x + H(y) \\ \\ &= \sin(xy) + x + H(y) \\ \\ F &= \int F_y \, dy \\ \\ &= \int x\cos(xy) + 1 \, dy \\ \\ &= \dfrac{x\sin(xy)}{x} + y + G(x) \\ \\ &= \sin(xy) + y + G(x) \end{aligned}$ Now we can set both ways of writing $F$ equal to find $G$ and $H$. $\sin(xy) + x + H(y) = \sin(xy) + y + G(x)$ Therefore: $\begin{aligned} G(x) &= x + C_1 \\ \\ H(y) &= y + C_2 \end{aligned}$ We can write $C_1$ and $C_2$ as a single arbitrary constant $C$ in the final version of $F$. Putting everything together: $F(x, y) = \sin(xy) + x + y + C$